//
//  SecondViewController.m
//  UI3_UIImageView课后作业
//
//  Created by dllo on 15/11/10.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "SecondViewController.h"
#import "SecondView.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageV.image = [UIImage imageNamed:@"bg.png"];
    [self.view addSubview:imageV];
    [imageV release];
    
    UIImageView *imageVU= [[UIImageView alloc] initWithFrame:CGRectMake(45, 130, [UIScreen mainScreen].bounds.size.width - 45 * 2, 40)];
    imageVU.image = [UIImage imageNamed:@"register_editor_upbg.png"];
    [self.view addSubview:imageVU];
    [imageVU release];
    
    UIImageView *imageVD = [[UIImageView alloc] initWithFrame:CGRectMake(imageVU.frame.origin.x, imageVU.frame.origin.y + imageVU.frame.size.height, imageVU.frame.size.width, imageVU.frame.size.height)];
    imageVD.image = [UIImage imageNamed:@"register_editor_downbg"];
    [self.view addSubview:imageVD];
    [imageVD release];
    
    UIImageView *imageVT = [[UIImageView alloc] initWithFrame:CGRectMake(0, 20, [UIScreen mainScreen].bounds.size.width, 40)];
    imageVT.image = [UIImage imageNamed:@"title_bg"];
    [self.view addSubview:imageVT];
    [imageVT release];
    
    UILabel *titleL = [[UILabel alloc] initWithFrame:CGRectMake(160, 0, 50, 40)];
    titleL.text = @"登陆";
    titleL.textColor = [UIColor whiteColor];
    [imageVT addSubview:titleL];
    [titleL release];
    
    UIButton *titleB = [UIButton buttonWithType:UIButtonTypeCustom];
    titleB.frame = CGRectMake(320, 20, 50, 40);
    [titleB setImage:[UIImage imageNamed:@"login_title_btn_normal"] forState:UIControlStateNormal];
    [titleB addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:titleB];
    
    UIButton *LoginB = [UIButton buttonWithType:UIButtonTypeCustom];
    LoginB.frame = CGRectMake(imageVD.frame.origin.x + 50, imageVD.frame.origin.y + imageVD.frame.size.height + 55, [UIScreen mainScreen].bounds.size.width - (imageVD.frame.origin.x + 55) * 2, 40);
    [LoginB setImage:[UIImage imageNamed:@"login_btn_normal"] forState:UIControlStateNormal];
    [LoginB setImage:[UIImage imageNamed:@"login_btn_press.png"] forState:UIControlStateHighlighted];
    
//    [LoginB addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:LoginB];
    
    SecondView *view1 = [[SecondView alloc] initWithFrame:CGRectMake(50, 135, [UIScreen mainScreen].bounds.size.width - 50 * 2, 30)];
    
    view1.label.text = @"账号";
    view1.textF.placeholder = @"邮箱地址或用户名";
    [self.view addSubview:view1];
    [view1 release];
    
    SecondView *view2 = [[SecondView alloc] initWithFrame:CGRectMake(view1.frame.origin.x, view1.frame.origin.y + view1.frame.size.height + 10, view1.frame.size.width, view1.frame.size.height)];
    
    view2.label.text = @"密码";
    view2.textF.placeholder = @"4-12位字符";
    [self.view addSubview:view2];
    [view2 release];
    
    
    
}

- (void)buttonAction
{
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
